home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Internet Info 1994 March
/
Internet Info CD-ROM (Walnut Creek) (March 1994).iso
/
networking
/
mail
/
mh
/
contrib
/
9302
/
prunemail.shar
/
prunemail
next >
Wrap
Text File
|
1993-02-03
|
928b
|
27 lines
#! /bin/csh -f
# eliminate all messages in $1 with duplicate message-ids
#
# Subject: MH utility to delete duplicate messages in a folder
# Date: Wed, 19 Aug 92 11:48:45 -0400
# From: Bob Munck <munck@Stars.Reston.Unisys.COM>
#
# Fixed to delete only messages with message-ids.
# Roger Corron <rc@boston.sgi.com>
#
# I debated using "$1" everywhere I have "+$1", since the user
# would then need the "+" and would be following MH conventions
# more closely. I suppose a real convention-following utility
# would also allow defaulting by using Path from ~/.mh-profile
# to find context and getting Current-Folder from it.
if ( ( $#argv == 0 ) || ( $1 == -help ) || ( $1 == -h ) ) then
echo 'USAGE: prune-mail folder'
exit 0
endif
folder +$1
set s = `scan +$1 -format "%4(putnumf(msg)) %{message-id}"|grep '.*<.*>.*' | sort +1|uniq -d +5|sed 's/ .*$//'`
if ( "$s" != "" ) then
rmm $s +$1
folder +$1
endif